---
id: running-tracetest-with-signoz-pokeshop
title: Pokeshop API and SigNoz
description: Quick start how to configure the Pokeshop API Demo to use Tracetest for enhancing your E2E and integration tests with trace-based testing with SigNoz as a trace data store.
hide_table_of_contents: false
keywords:
  - tracetest
  - trace-based testing
  - observability
  - distributed tracing
  - testing
  - signoz
  - signoz observability
  - signoz tracing
  - opentelemetry
image: https://res.cloudinary.com/djwdcmwdz/image/upload/v1698686403/docs/Blog_Thumbnail_14_rsvkmo.jpg
---

:::note
[Check out the source code on GitHub here.](https://github.com/kubeshop/tracetest/tree/main/examples/tracetest-signoz-pokeshop)
:::

[Tracetest](https://tracetest.io/) is a testing tool based on [OpenTelemetry](https://opentelemetry.io/) that allows you to test your distributed application. It allows you to use data from distributed traces generated by OpenTelemetry to validate and assert if your application has the desired behavior defined by your test definitions.

[SigNoz](https://signoz.io/) is an open-source observability tool. A single tool for all your observability needs - APM, logs, metrics, exceptions, alerts, and dashboards powered by a powerful query builder.

[Pokeshop API](https://docs.tracetest.io/live-examples/pokeshop/overview) is a testing ground, the team at Tracetest has implemented a sample instrumented API around the [PokeAPI](https://pokeapi.co/).

## Pokeshop API with SigNoz, OpenTelemetry and Tracetest

This is a simple quick start guide on how to configure a fully instrumented API to be used with Tracetest for enhancing your E2E and integration tests with trace-based testing. The infrastructure will use SigNoz as the trace data store and the Pokeshop API to generate the telemetry data.


## Prerequisites

**Tracetest Account**:

- Sign up to [`app.tracetest.io`](https://app.tracetest.io) or follow the [get started](/getting-started/overview) docs.
- Have access to the environment's [agent API key](https://app.tracetest.io/retrieve-token).

**Docker**: Have [Docker](https://docs.docker.com/get-docker/) and [Docker Compose](https://docs.docker.com/compose/install/) installed on your machine.

## Run This Quckstart Example

The example below is provided as part of the Tracetest project. You can download and run the example by following these steps:

Clone the Tracetest project and go to the SigNoz Pokeshop Quickstart:

```bash
git clone https://github.com/kubeshop/tracetest
cd tracetest/examples/tracetest-signoz-pokeshop
```

Follow these instructions to run the quick start:

1. Copy the `.env.template` file to `.env`.
2. Fill out the [TRACETEST_TOKEN and ENVIRONMENT_ID](https://app.tracetest.io/retrieve-token) details by editing your `.env` file.
3. Run `docker compose run tracetest-run`.
4. Follow the links in the output to view the test results.

Follow along with the sections below for an in detail breakdown of what the example you just ran did and how it works.

## Project Structure

The project contains the [Tracetest Agent](/getting-started/install-agent), and the [Pokeshop Demo app](/live-examples/pokeshop/overview).

The `docker-compose.agent.yaml` file in the root directory of the quick start runs the Pokeshop Demo app, [SigNoz](https://github.com/SigNoz/signoz), and the [Tracetest Agent](/concepts/agent) setup.

## Configuring the Pokeshop Demo App

The Pokeshop API is a fully instrumented REST API that makes use of different services to mimic a real life scenario.

It is instrumented using the [OpenTelemetry standards for Node.js](https://opentelemetry.io/docs/instrumentation/js/getting-started/nodejs/), sending the data to the ADOT collector that will be pushing the telemetry information to both the AWS X-Ray service.

This is a [fragment from the main tracing file](https://github.com/kubeshop/pokeshop/blob/master/api/src/telemetry/tracing.ts) from the [Pokeshop API repo](https://github.com/kubeshop/pokeshop).

Configure the `.env` like shown below.

```bash
# Get the required information here: https://app.tracetest.io/retrieve-token

TRACETEST_TOKEN="<YOUR_TRACETEST_TOKEN>"
TRACETEST_ENVIRONMENT_ID="<YOUR_ENV_ID>"
```

## Run Pokeshop, SigNoz, and Tracetest

To execute the tests, run this command:

```bash
docker compose run tracetest-run
```

This will:
1. Start the Node.js app, the OpenTelemetry Collector, and send the traces to Signoz.
2. Start the Tracetest Agent.
3. Configure the SigNoz tracing backend and create tests in your environment.
4. Run the tests.

The output of the test will look similar to this:

```bash
Configuring Tracetest
 SUCCESS  Successfully configured Tracetest CLI
Running Trace-Based Tests...
✔ RunGroup: #RLG4_lCSR (https://app.tracetest.io/organizations/ttorg_e66318ba6544b856/environments/ttenv_4b0e8945dbe5045a/run/RLG4_lCSR)
 Summary: 1 passed, 0 failed, 0 pending
  ✔ Pokeshop - Import (https://app.tracetest.io/organizations/ttorg_e66318ba6544b856/environments/ttenv_4b0e8945dbe5045a/test/ZVJwkpC4g/run/1/test) - trace id: 538981f2be22430a3ec260772ed00c83
	✔ All HTTP Spans: Status  code is 200
	✔ Validate that this span always exists after the message queue
	✔ Validate that Redis is using Charizard.
	✔ Validate that the Postgres has Charizard.
```

## View Trace Spans Over Time in SigNoz

To access a historical overview of all the trace spans the Pokeshop Demo app generates, jump over to SigNoz. With SigNoz and Tracetest, you get the best of both worlds. You can run trace-based tests and automate running E2E and integration tests against real trace data. And, use SigNoz to get a historical overview of all traces your distributed application generates.

![honeycomb](https://res.cloudinary.com/djwdcmwdz/image/upload/v1697715807/Blogposts/signoz-integration/new/image_53_ms9rcw.webp)

## Learn More

Please visit our [examples in GitHub](https://github.com/kubeshop/tracetest/tree/main/examples) and join our [Slack Community](https://dub.sh/tracetest-community) for more info!
